#include "../src/cell.h"
#include "../src/utils.h"
#include "../src/config.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#define DEFAULT_MAX_ENERGY      100
#define DEFAULT_MAX_AGE         1000
#define DEFAULT_MAX_FOOD_AGE    800
#define DEFAULT_MUTATION_CHANCE 10000
#define DEFAULT_DAY_LENGTH      40000

// Global to link files
char filepath[MAX_PATH_LENGTH];
int main(int argc, char **argv) {
    static struct World world;
    if(argc < 3 || argc > 4) {
        printf("Usage: %s <width> <height> [output file]\n", argv[0]);
        return(-1);
    }
    if(argc == 4) {
        strcpy(filepath, argv[3]);
    } else {
        strcpy(filepath, "world.bin");
    }
    int width  = atoi(argv[1]);
    int height = atoi(argv[2]);
    world.maxEnergy = DEFAULT_MAX_ENERGY;
    world.mutationChance = DEFAULT_MUTATION_CHANCE;
    world.dayLength = DEFAULT_DAY_LENGTH;
    world.maxAge = DEFAULT_MAX_AGE;
    world.foodMaxAge = DEFAULT_MAX_FOOD_AGE;
    world.timeDirection = true;
    init(&world, width, height);
    exportWorld(&world);
    return(0);
}

